package com.quectel.core.module.village.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 小区
 *
 * @author caolu
 * @email louis.cao@quectel.com
 * @date 2021-10-18 14:41:21
 */
@Data
@Schema
public class VillageDto implements Serializable {

    /**
     * id主键
     */
    @Schema(description = "id主键")
    private Long id;
    /**
     * 租户id
     */
    @Schema(description = "租户id")
    private Long tenantId;

    /**
     * 省份编码
     */
    @Schema(description = "省份编码")
    @NotEmpty
    @Length(min = 1, max = 50)
    private String provinceCode;

    /**
     * 省份名称
     */
    @Schema(description = "省份名称")
    @NotEmpty
    @Length(min = 1, max = 50)
    private String provinceName;

    /**
     * 市编码
     */
    @Schema(description = "市编码")
    @NotEmpty
    @Length(min = 1, max = 50)
    private String cityCode;

    /**
     * 市名称
     */
    @Schema(description = "市名称")
    @NotEmpty
    @Length(min = 1, max = 50)
    private String cityName;

    /**
     * 区编码
     */
    @Schema(description = "区编码")
    @NotEmpty
    @Length(min = 1, max = 50)
    private String districtCode;

    /**
     * 区名称
     */
    @Schema(description = "区名称")
    @NotEmpty
    @Length(min = 1, max = 50)
    private String districtName;

    /**
     * 街道编码
     */
    @Schema(description = "街道编码")
    @NotEmpty
    @Length(min = 1, max = 50)
    private String streetCode;

    /**
     * 街道名称
     */
    @Schema(description = "街道名称")
    @NotEmpty
    @Length(min = 1, max = 50)
    private String streetName;

    /**
     * 小区编码
     */
    @Schema(description = "小区编码")
    @NotEmpty
    @Length(min = 1, max = 50)
    private String code;

    /**
     * 小区名称
     */
    @Schema(description = "小区名称")
    @NotEmpty
    @Length(min = 1, max = 80)
    private String name;

    /**
     * 小区地址
     */
    @Schema(description = "小区地址")
    private String address;

    /**
     * 经度
     */
    @Schema(description = "经度")
    @DecimalMax(value = "180")
    @DecimalMin(value = "-180")
    private BigDecimal longitude;

    /**
     * 纬度
     */
    @Schema(description = "纬度")
    @DecimalMax(value = "90")
    @DecimalMin(value = "-90")
    private BigDecimal latitude;

    /**
     * 大屏优先展示3d 1是0否
     */
    @Schema(description = "大屏优先展示3d 1是0否")
    @NotNull
    private Byte enableThreeD;

    /**
     * 小区详情
     */
    @Schema(description = "小区详情")
    private String villageExplain;

    /**
     * 特殊字段
     */
    @Schema(description = "特殊字段")
    private String extraAttr;

    /**
     * 创建人
     */
    @Schema(description = "创建人")
    private String creator;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private Date createTime;

    /**
     * 修改人
     */
    @Schema(description = "修改人")
    private String editor;

    /**
     * 修改时间
     */
    @Schema(description = "修改时间")
    private Date editTime;

    /************非数据库字段 start ************/
    @Schema(description = "扩展字段")
    private ExtraAttrCls extraAttrCls;

    /************非数据库字段 end **************/

    @Data
    @Schema
    public static class ExtraAttrCls implements Serializable {
        /**
         * 小区物业公司名称
         */
        @Schema(description = "小区物业公司名称")
        private String companyName;

        /**
         * 物业公司联系人
         */
        @Schema(description = "物业公司联系人")
        private String companyContact;

        /**
         * 物业联系电话
         */
        @Schema(description = "物业联系电话")
        private String mobile;

        /**
         *
         */
        @Schema(description = "地图边界")
        private String polygonPath;

        /**
         * 地图缩放等级
         */
        @Schema(description = "地图缩放等级")
        private Byte zoom;

    }
}
